package com.itheima.reggie.controller;

import com.itheima.reggie.common.R;
import com.itheima.reggie.entity.Category;
import com.itheima.reggie.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商品分析
 */
@RestController
@RequestMapping("/commodity")
@Slf4j
public class CommodityController {

    @Autowired
    private CategoryService categoryService;
    @GetMapping
    public R<List<Category>> list (){
        List<Category> list = categoryService.list();
        return R.success(list);
    }
}
